package com.yxw.yx_hotel.service.impl;

import com.yxw.yx_hotel.mapper.OverviewMapper;
import com.yxw.yx_hotel.service.OverviewService;
import com.yxw.yx_hotel.vo.CustomerGrowthTrendVo;
import com.yxw.yx_hotel.vo.CustomerlistingsVo;
import com.yxw.yx_hotel.vo.RoomGrowthTrendVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 *  首页概览
 * @author liuxin
 * @date 2024.01.24
 */
@Service
public class OverviewServiceImpl implements OverviewService {

    @Autowired
    private OverviewMapper overviewMapper;

    /**
     * 客户/房源查询
     * @return
     */
    @Override
    public CustomerlistingsVo getCustomerlistings() {
        return overviewMapper.getCustomerlistings();
    }

    /**
     * 客户增长趋势
     *
     * @return
     */
    @Override
    public List<CustomerGrowthTrendVo> getCustomerGrowthTrend(Integer queryRange) {
        List<CustomerGrowthTrendVo> voList=overviewMapper.getCustomerGrowthTrend(queryRange);
        return voList;
    }

    /**
     * 房源增长趋势
     * @param queryRange
     * @return
     */
    @Override
    public List<RoomGrowthTrendVo> getRoomGrowthTrend(Integer queryRange) {
        List<RoomGrowthTrendVo> voList=overviewMapper.getRoomGrowthTrend(queryRange);
        return voList;
    }
}
